package com.haibara.codesubmiteval.constant;

/**
 * 文件常量
 *
 * @Author: mengyu
 * @Date: 2025/2/5
 */
public interface FileConstant {
    // 临时文件文件夹
    String tempFilePath = "/root/oj/tempFile";
    // 用户代码文件夹
    String codeFilePath = "/root/oj/code";
    // 文件输入文件夹
    String inputFilePath = "/root/oj/inputFile";
    // 文件输出文件夹
    String outputFilePath = "/root/oj/outputFile";
    // 用户输出文件夹
    String userOutputFilePath = "/root/oj/userOutputFile";

    static String getTempFilePath(String filename) {
        return tempFilePath + "/" + filename;
    }

    static String getInputFilePath(Long questionId, Long caseId, String filename) {
        return inputFilePath + "/" + questionId + "/" + caseId + "/" + filename;
    }

    static String getOutputFilePath(Long questionId, Long caseId, String filename) {
        return outputFilePath + "/" + questionId + "/" + caseId + "/" + filename;
    }

    static String getInputFilePath(Long questionId, Long caseId) {
        return inputFilePath + "/" + questionId + "/" + caseId;
    }

    static String getOutputFilePath(Long questionId, Long caseId) {
        return outputFilePath + "/" + questionId + "/" + caseId;
    }

    static String getCodePath(Long userId, Long questionId) {
        return codeFilePath + "/" + userId + "/" + "question" + questionId + ".sh";
    }

    static String getUserOutputFilePath(Long userId, Long questionId) {
        return userOutputFilePath + "/" + userId + "/" + questionId;
    }

    static String getUserOutputFilePath(Long userId, Long questionId, Long caseId) {
        return userOutputFilePath + "/" + userId + "/" + questionId + "/" + "case" + caseId + ".txt";
    }
}
